package com.cn.config;

import java.util.Properties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.github.pagehelper.PageHelper;


/**
 * @ClassName: MyBatisConfig
 * @Description: TODO
 * @author Administrator
 * @date 2017年6月7日
 */

/*
 * 注册MyBatis分页插件PageHelper
 */

@Configuration
public class MybatisConfig {
	    @Bean
	    public PageHelper pageHelper() {
	        PageHelper pageHelper = new PageHelper();
	        Properties p = new Properties();
	        p.setProperty("offsetAsPageNum", "true");
	        p.setProperty("rowBoundsWithCount", "true");
	        p.setProperty("reasonable", "true");
	        pageHelper.setProperties(p);
	        return pageHelper;
	    }
}